<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <script src="./vue.js"></script>
</head>

<body>
  <div id="vm">
    <cpn></cpn>
    <cpn2></cpn2>
  </div>
  <script type="text/x-template" id="cpn">
    <div>
      <h1>我是标题1</h1>
      <p>{{title}}</p>
      <p>123123</p>
      <p>123123</p>
    </div>
  </script>
  <template id="cpn2">
    <div>
      <h1>我是标题2</h1>
      <p>12312223</p>
      <p>123121233</p>
      <p>123112323</p>
    </div>
  </template>
  <script>
    Vue.component('cpn', { //传入对象
      template: '#cpn',
      data(){
        return {
          title:'avx'
        }
      }
    }) //全局组件注册
    Vue.component('cpn2', { //传入对象
      template: '#cpn2'
    }) //全局组件注册
    var vm = new Vue({
      el: '#vm',
      data: {
        name: 'Taec'
      }
    })
  </script>
</body>

</html>